package com.naive.imperative.program;


public class Variable extends Operation {
	private String name;
	private EvaluatableOperation<Object> assignExpression;
	
	@Override
	public void execute(ExecutionContext x) {
		x.declareVar(name);
		final Object o = assignExpression.evaluate(x);
		x.setVar(name, o);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public EvaluatableOperation<Object> getAssignExpression() {
		return assignExpression;
	}

	public void setAssignExpression(EvaluatableOperation<Object> assignExpression) {
		this.assignExpression = assignExpression;
	}
}
